<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<%
String path = request.getContextPath();
String basepath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>粤西农批收费管理系统</title>
    <meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" name="viewport" />
    <meta content="black" name="apple-mobile-web-app-status-bar-style" />
    <meta content="telephone=no" name="format-detection" />
    <link href="<%=basepath%>css/index.css" rel="stylesheet" type="text/css">
    <link href="<%=basepath%>css/index-1.css" rel="stylesheet" type="text/css">
    <script src="<%=basepath%>js/jquery-1.8.3.min.js"></script>
    <script src="<%=basepath%>js/layer/layer.js"></script>
    <script src="<%=basepath%>js/TouchSlide.1.1.js"></script>
</head>
<body>
<%
String code = request.getParameter("code");
String state =request.getParameter("state");
%>
<div class="viewport">
    <div class="header">
       <div class="header-1">
           <a href="javascrpt:void(0)" id="join" class="header-2">
              <span id="account" class="account">${empty user.realName ? '' : user.realName}</span>&nbsp;&nbsp;<span id="deptName" class="deptName">${user.departmentName}</span>
           </a>
           <a href="/wape-web/api/core/centerService?serviceCode=WJ9999&targetURL=yuexi&prefix=3g_mmzs&entrance=yes" class="back" id="back">返回</a>
           <span class="span-num main">WOP20000</span>
       </div>
    </div>
    <script type="text/javascript">$("#back").hide();</script>
    <div class="content m-top">
        <div class="content-1">
            <div id="slideBox" class="slideBox">
                <div class="bd">
                    <ul>
                        <li>
                            <a class="pic" href="javascript:void(0)"><img src="<%=basepath%>images/a1.jpg" /></a>
                            <a class="tit" href="javascript:void(0)">中国农商产业领跑者</a>
                        </li>
                        <li>
                            <a class="pic" href="javascript:void(0)"><img src="<%=basepath%>images/a2.jpg"/></a>
                            <a class="tit" href="javascript:void(0)">惠农惠民，便民服务</a>
                        </li>
                        <li>
                            <a class="pic" href="javascript:void(0)"><img src="<%=basepath%>images/a7.jpg"/></a>
                            <a class="tit" href="javascript:void(0)">生鲜配送</a>
                        </li>
                        <li>
                            <a class="pic" href="javascript:void(0)"><img src="<%=basepath%>images/a4.jpg"/></a>
                            <a class="tit" href="javascript:void(0)">有机农产品定制</a>
                        </li>
                    </ul>
                </div>
                <div class="hd">
                    <ul></ul>
                </div>
                <script type="text/javascript">
                    TouchSlide({
                        slideCell:"#slideBox",
                        titCell:".hd ul",
                        mainCell:".bd ul",
                        effect:"leftLoop",
                        autoPage:true,
                        autoPlay:true
                    });
                </script>
            </div>
        </div>
        <div class="content-3">
            <div class="content-3-1 hui">
                <a class="content-3-1-1 ctp-3-1-1" href="javascript:void(0)">
                    <span class="span-1">粤西农批</span><span class="span-2">季节性临时收费管理</span>
                </a>

            </div>
            <div class="content-3-2">
                <ul>
                    <li class="li-1"><a href="/wape-web/api/core/centerService?serviceCode=MMZS108"><img src="<%=basepath%>images/cheweianpai.png"><br/><span>车位安排</span> </a> </li>
                    <li><a href="/wape-web/api/core/centerService?serviceCode=MMZS120&queryType=1"><img src="<%=basepath%>images/caiwushoufei.png"><br/><span>收费管理</span> </a> </li>
                    <li><a href="/wape-web/api/core/centerService?serviceCode=MMZS124"><img src="<%=basepath%>images/b12.png"><br/><span>缴费报告</span> </a> </li>
                    <li></li>
                    <li class="li-5"></li>
                </ul>
            </div>
            <div class="content-0"></div>
        </div>
        <div class="space"></div>
    </div>
</div>
</body>
<script type="text/javascript">
    /*错误提示*/
    $(function(){
        var error = "${requestScope.returnMsg}";
        if(error != "" && error != "成功!"){
            layer.msg(error,{shadeClose:true,shade:0.1,time:2000});
        }
    });
    /*识别浏览器*/
    $(function(){
        var ua = window.navigator.userAgent.toLowerCase();
        if(ua.match(/MicroMessenger/i) == 'micromessenger'){
            /*微信自动登录 */
            layer.load();
            $.ajax({
                url:"/wape-web/api/core/centerService",
                dataType:"json",
                data:{
                    serviceCode:"1001W01",
                    code:"<%=code %>"
                },
                complete:function(xhr,status){
                	var openId = xhr.responseText.replace(/(\n)+|(\r\n)+/g, "");
                    //alert(openId);
                    if(openId == "null" || openId == ""){
                        layer.closeAll();
                        //layer.msg("微信认证失败，请联系管理员！",{shadeClose:true,shade:0.1,time:2000});
                        window.location.href="/wape-web/api/core/centerService?serviceCode=WJ9999&targetURL=yuexi&prefix=3g_mmzs&entrance=yes";
                    }
                    else{
                    	$.ajax({
                            type:"post",
                            url:"/wape-web/api/core/centerService",
                            data:{
                                serviceCode:"1001W02",
                                sign: 'web',
                                timestamp: 'web',
                                nonce: 'web',
                                editUser: 'web',
                                editTime: 'web',
                                device: 'web',
                                ipaddr: 'web',
                                mac: 'web',
                                openId:openId
                            },
                            success:function(data){
                                var wechat = eval("("+data+")");
                                //alert(data);
                                if(wechat.returnCode == "200"){
                                    layer.closeAll();
                                    //alert(200);
                                    if(wechat.result.realName != ""){
                                        $("#account").text(wechat.result.realName);
                                    }
                                    else if(wechat.result.realName == ""){
                                        $("#account").text("您还未登录哦！");
                                    }
                                    $("#compNickName").text(wechat.result.companyNickName);
                                    $("#deptName").text(wechat.result.departmentName);
                                }
                                else{
                                    //alert(500);
                                    layer.closeAll();
                                    $("#account").text("您还未登录哦！");
                                    layer.msg("您未绑定农商号，请登录绑定！",{shadeClose:true,shade:0.1,time:2000});
                                }
                            }
                        })
                    }
                }
            });
        }
        else{}
    });
</script>
</html>


